home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / mail / smail2.lha / SMail / install-smail < prev    next >
Encoding:
Text File  |  1993-11-29  |  15.6 KB  |  594 lines

  1. ;
  2. ; Script to install SMail
  3. ;
  4. ;=================== init ===============
  5.  
  6. (complete 0)
  7. (set default-dest "uucp:c")
  8. (set @app-name "SMail")
  9. (set @default-dest "UUCP:C")
  10. (set need-version 37)
  11.  
  12. (welcome "    Welcome to " @app-name " installation.\n")
  13.  
  14. (set exec-version (/ (getversion) 65536))
  15. (if (< exec-version need-version)    ; check operating system version
  16.      ((message @app-name " needs at least Exec version " need-version
  17.            " to run.\nYou have only version " exec-version ".\n"
  18.            "You can proceed with the installation, but consider "
  19.            "installing the " @app-name " with proper version of "
  20.            "the operating system."
  21.            (help
  22.         "    The " @app-name " uses some system functions "
  23.         "that are not present or functional in earlier system "
  24.         "versions. Consider updating your system.\n"
  25.         "    If you have a later version of operating system "
  26.         "and are only now using older version: be sure to use "
  27.         "only release 2.04 or newer with " @app-name ". "
  28.         "No damage happens if you run " @app-name " with an "
  29.         "earlier operating system, however. It just "
  30.         "refuses to start.\n"))))
  31.  
  32. ;=================== search assings ==========
  33. (if (= @user-level 2)
  34.     (set UULIB
  35.     (askdir
  36.         (prompt "Where do you keep your uucp configs ?")
  37.         (help @askdir-help)
  38.         (default "UULIB:")
  39.     )
  40.     )
  41.     (set UULIB "UULIB:")
  42. )
  43.  
  44.  
  45. (if (= @user-level 2)
  46.     (set UUBIN
  47.     (askdir
  48.         (prompt "Where do you keep your uucp binarys ?")
  49.         (help @askdir-help)
  50.         (default "UUCP:C")
  51.     )
  52.     )
  53.     (set UUBIN "UUCP:C")
  54. )
  55.  
  56. (if (= @user-level 2)
  57.     (set UUSPOOL
  58.     (askdir
  59.         (prompt "Where do you keep your uucp spool files ?")
  60.         (help @askdir-help)
  61.         (default "UUSPOOL:")
  62.     )
  63.     )
  64.     (set UUSPOOL "UUSPOOL:")
  65. )
  66. (set @default-dest UUBIN)
  67.  
  68. (set sendmail (tackon UUBIN "sendmail"))
  69. (set rmail (tackon UUBIN "rmail"))
  70. (set mail (tackon UUBIN "mail"))
  71. (set smail (tackon UUBIN "smail"))
  72. (set rsmtp (tackon UUBIN "rsmtp"))
  73. (set rcsmtp (tackon UUBIN "rcsmtp"))
  74. (set rfsmtp (tackon UUBIN "rfsmtp"))
  75. (set batch_smtp (tackon UUBIN "batch_smtp"))
  76.  
  77. ;================= backup existings files ==========
  78. (set backup (askbool
  79.         (prompt " Do you want to backup your existing "sendmail","rmail","rcsmtp
  80.                "," rfsmtp" and "rsmtp" to T:")
  81.        (choices "Proceed" "Skip this Part")
  82.         (default 0)
  83.         (help "none available :-(")
  84. ))
  85.  
  86. (if (= backup 1)
  87. (
  88. (if (exists mail)
  89.     (copyfiles
  90.     (prompt "Backup original programs from " UUBIN)
  91.     (help @copyfiles-help)
  92.     (source mail)
  93.     (dest "t:")
  94.     (infos)
  95.     (confirm)
  96.     )
  97. )
  98.  
  99. (if (exists rsmtp)
  100.     (copyfiles
  101.     (prompt "Backup original programs from " UUBIN)
  102.     (help @copyfiles-help)
  103.     (source rsmtp)
  104.     (dest "t:")
  105.     (infos)
  106.     (confirm)
  107.     )
  108. )
  109.  
  110. (if (exists rcsmtp)
  111.     (copyfiles
  112.     (prompt "Backup original programs from " UUBIN)
  113.     (help @copyfiles-help)
  114.     (source rcsmtp)
  115.     (dest "t:")
  116.     (infos)
  117.     (confirm)
  118.     )
  119. )
  120.  
  121. (if (exists rfsmtp)
  122.     (copyfiles
  123.     (prompt "Backup original programs from " UUBIN)
  124.     (help @copyfiles-help)
  125.     (source rfsmtp)
  126.     (dest "t:")
  127.     (infos)
  128.     (confirm)
  129.     )
  130. )
  131.  
  132. (if (exists rmail)
  133.     (copyfiles
  134.     (prompt "Backup original programs from " UUBIN)
  135.     (help @copyfiles-help)
  136.     (source rmail)
  137.     (dest "t:")
  138.     (infos)
  139.     (confirm)
  140.     )
  141. )
  142.  
  143. (if (exists sendmail)
  144.     (copyfiles
  145.     (prompt "Backup original programs from " UUBIN)
  146.     (help @copyfiles-help)
  147.     (source sendmail)
  148.     (dest "t:")
  149.     (infos)
  150.     (confirm)
  151.     )
  152. )
  153.  
  154. (if (exists batch_smtp)
  155.     (copyfiles
  156.     (prompt "Backup original programs from " UUBIN)
  157.     (help @copyfiles-help)
  158.     (source batch_smtp)
  159.     (dest "t:")
  160.     (infos)
  161.     (confirm)
  162.     )
  163. )))
  164.  
  165. ;================ delete old files ================
  166. (complete 20)
  167.  
  168. (debug (run (cat "delete force "mail)))
  169. (debug (run (cat "delete force "smail)))
  170. (debug (run (cat "delete force "rsmtp)))
  171. (debug (run (cat "delete force "rcsmtp)))
  172. (debug (run (cat "delete force "rfsmtp)))
  173. (debug (run (cat "delete force "sendmail)))
  174.  
  175. ;================ copy files to uubin =============
  176. (complete 25)
  177. (copylib
  178.     (prompt "copy netsupport.library")
  179.     (help @copylib-help)
  180.     (source "libs/netsupport.library")
  181.     (dest    "libs:")
  182.     (confirm)
  183. )
  184.  
  185. (set axsh 0)
  186. (set choice (askchoice
  187.         (prompt " Do you want to install the AXSh versions of SMail/RMail ?")
  188.         (choices "Getty" "AXSh" "MultiUserFilesystem")
  189.         (default 0)
  190.         (help "Getty\n"
  191.  "Insert all users of your site in getty:passwd. Insert in "
  192.  "the comment part the realname of the user.This is only "
  193.  "important for the Realname if you donnot use the local "
  194.  "enviroment variable REALNAME. Besides smail takes the home-directory "
  195.  "for `Mail forwarding' from the getty's passwd.\n"
  196.  "AXSh\n"
  197.  "These programs use the AXSh passwd instead of Gettys passwd.\n"
  198.  "MUFS\n"
  199.  "These programs use the MUFS passwd instead of Gettys passwd.")))
  200. (if (= choice 0)
  201.     (copyfiles
  202.             (prompt "Install Getty programs...")
  203.             (help @copyfiles-help)
  204.            (source "bin")
  205.             (dest UUBIN)
  206.             (choices "smail" "mail" "convert" "batch_smtp")
  207.             (infos)
  208.             (confirm))
  209. )
  210.  
  211. (if (= choice 1)
  212.     (
  213.     (copyfiles
  214.             (prompt "Install AXSh programs...")
  215.             (help @copyfiles-help)
  216.            (source "bin")
  217.             (dest UUBIN)
  218.             (choices "smail_axsh" "mail_axsh" "convert" "batch_smtp")
  219.             (infos)
  220.             (confirm))
  221.              (set smail2 (tackon UUBIN "smail_axsh"))
  222.              (set mail2 (tackon UUBIN "mail_axsh"))
  223.              (set axsh 1)
  224.              (debug (run (cat "c:rename from="smail2" to="smail)))
  225.              (debug (run (cat "c:rename from="mail2" to="mail)))
  226.     )
  227. )
  228.  
  229. (if (= choice 2)
  230.     (
  231.     (copyfiles
  232.             (prompt "Install MUFS programs...")
  233.             (help @copyfiles-help)
  234.            (source "bin")
  235.             (dest UUBIN)
  236.             (choices "smail_mufs" "mail_mufs" "convert" "batch_smtp")
  237.             (infos)
  238.             (confirm))
  239.              (set smail2 (tackon UUBIN "smail_mufs"))
  240.              (set mail2 (tackon UUBIN "mail_mufs"))
  241.              (set axsh 2)
  242.              (debug (run (cat "c:rename from="smail2" to="smail)))
  243.              (debug (run (cat "c:rename from="mail2" to="mail)))
  244.     )
  245. )
  246.  
  247. ;================== generate rmail and sendmail =================
  248. (complete 60)
  249. (debug (run (cat "delete force "rmail)))
  250. (debug (run (cat "delete force "sendmail)))
  251. (if (= 0 (askchoice
  252.             (prompt "sendmail, rmail, rsmtp, rcsmtp and rfsmtp\nare the same programs as smail\n")
  253.             (choices "generate a hardlink"
  254.                  "generate copies")
  255.             (default 0)
  256.             (help "If you use Hardlinks there could(!) be problems with "
  257.                 "your filesystem, because hardlinks are not fully "
  258.                 "supported by the OS.")
  259.           )
  260.     )
  261.     (
  262.     (debug (run (cat "c:Makelink to="smail" from="rmail)))
  263.     (debug (run (cat "c:Makelink to="smail" from="sendmail)))
  264.     (debug (run (cat "c:Makelink to="smail" from="rsmtp)))
  265.     (debug (run (cat "c:Makelink to="smail" from="rcsmtp)))
  266.     (debug (run (cat "c:Makelink to="smail" from="rfsmtp)))
  267.     )
  268.     (
  269.     (debug (run (cat "c:copy clone from="smail" to="rmail)))
  270.     (debug (run (cat "c:copy clone from="smail" to="sendmail)))
  271.     (debug (run (cat "c:copy clone from="smail" to="rsmtp)))
  272.     (debug (run (cat "c:copy clone from="smail" to="rcsmtp)))
  273.     (debug (run (cat "c:copy clone from="smail" to="rfsmtp)))
  274.     )
  275. )
  276. ;=================== generate the uulib:config entries ==========
  277. (complete 80)
  278.  
  279. (set uuconfig (askbool
  280.         (prompt " Do you want to install or modify the uulib:config"
  281.                " entries for Smail ?\n"
  282.                " If you don't use this option please refer to Smail.guide "
  283.                " chapter \"Misc/Config options\" and modify the options "
  284.                " according to your wishes.")
  285.        (choices "Proceed" "Skip this Part")
  286.         (default 0)
  287.         (help " If you select \"Skip this Part\" the installer script "
  288.              " will not modify your uulib:config. If you select \"Proceed\""
  289.              " the installer script will ask you some questions and will "
  290.              " include the Smail options to your uulib:config file." )
  291. ))
  292.  
  293. (if (= uuconfig 1)
  294.  (
  295.  (set tmp (tackon UULIB "mail"))
  296.  (if (NOT (= (exists tmp (noreq)) 2))
  297.      (debug (run (cat "makedir " tmp)))
  298.  )
  299.  
  300.  (set tmp (tackon UUSPOOL "batch"))
  301.  (if (NOT (= (exists tmp (noreq)) 2))
  302.      (debug (run (cat "makedir " tmp)))
  303.  )
  304.  
  305.  (set line1
  306.   (askstring
  307.    (prompt "The name of your smarthost (with domain)?")
  308.     (default "foo.bar")
  309.     (help "The host, that receives all mails from you, "
  310.           "which can't be found in the path file")
  311.    )
  312.  )
  313.  
  314.  (set line2
  315.   (askfile
  316.    (prompt "Where should the DillonUUCP styled logfile should go (use a emtpy string for NIL:)?\n")
  317.    (help "You can use your normal DillonUUCP logfile uuspool:logfile "
  318.          "or define a new one. Don't forget from time to time to trim this file.")
  319.    (default "uuspool:logfile")
  320.   )
  321.  )
  322.  
  323.  (set line3
  324.   (askfile
  325.    (prompt "Where should the CNews styled logfile should go (use a emtpy string for NIL:)? ")
  326.    (help "It uses nearly the same syntax as CNews. The main difference "
  327.          "to DillonUUCP styled logfile is, that you can see, whether "
  328.          "a mail transport was successful.")
  329.    (default "uulib:mail/logfile")
  330.   )
  331.  )
  332.  
  333.  (set line4
  334.   (askfile
  335.    (prompt "Where should the logfile with the full mailbody should go (use a emtpy string for NIL:)?")
  336.    (help "In this logfile smail logs all mail delivery with the fully mail "
  337.          "body. Normally you should only use this option for debugging")
  338.    (default "t:smail.log")
  339.   )
  340.  )
  341.  
  342.  (if (= 0 axsh)
  343.      (set line5
  344.       (askfile
  345.            (prompt "Where is the Getty passwd file ?\n")
  346.            (help "GETTY:PASSWD is similar to the UNIX /etc/passwd file and is "
  347.              "currently used by Getty to verify remote logins and run the "
  348.               "appropriate 'shell', which in most cases will be uucico.  The "
  349.               "format is:\n\n"
  350.              "------ start of GETTY:PASSWD -----\n"
  351.              "# Put any comment here\n"
  352.              "#\n"
  353.              "# User,Password,Uid,GroupId,Finger-Info,Home-Dir,Command-To-Run\n"
  354.              "bbs,*,10,0,BBS,ram:,mybbs:c/mybbs\n")
  355.           (default "getty:passwd")
  356.       )
  357.      )
  358.  )
  359.  
  360.  (set line6
  361.   (askfile
  362.    (prompt "Where is your alias file ?\n")
  363.    (help "This file contains a list of aliases for local users or "
  364.          "mailing lists.  The format of each alias is\n"
  365.          "    alias_name recip_name1 recip_name2 ... ")
  366.    (default "uulib:mail/aliases")
  367.   )
  368.  )
  369.  
  370.  (set line12
  371.   (askfile
  372.    (prompt "Where is/should your  path file ?\n")
  373.    (help "Look at smail.guide for more help")
  374.    (default "uulib:mail/paths")
  375.   )
  376.  )
  377.  
  378.  (set line7
  379.   (askchoice
  380.    (choices "use rerouting" "don't use rerouting" "don't route anything")
  381.    (prompt "Rerouting ability ?\n")
  382.    (help " 'don't use rerouting' causes smail/rmail to attempt to route the first "
  383.          " component of a UUCP path, probably so it can impress people "
  384.          " with how many UUCP hosts it knows.  If this fails, it passes "
  385.          " the unrouted address to uux, in case the path database is "
  386.          " not complete.  'use rerouting' causes smail/rmail to take a UUCP "
  387.          " path and route the rightmost component of the path (save the "
  388.          " user name) possible.  This is mostly for hosts that have "
  389.          " very up-to-date routing tables.")
  390.    (default 0)
  391.   )
  392.  )
  393.  
  394.  (set line8
  395.   (if
  396.    (= 0
  397.     (askchoice
  398.      (choices "Return-To-Receipt Headers"  "ignore Return-To-Receipt Headers")
  399.      (prompt "Return-To-Receipt Headers...\n")
  400.      (help "smail/rmail will send an mail with a copy of the header "
  401.            "of the original mail to the address after the Return-To-Receipt: "
  402.            "Header. You can turn this off via the SMReceipt keyword in the "
  403.            "uulib:config file. See smail.guide for the recognition "
  404.            "whether a user exists on your site.")
  405.      (default 0)
  406.     )
  407.    )
  408.    ("Yes")
  409.    ("No")
  410.   )
  411.  )
  412.  
  413.  (set nr
  414.   (askchoice
  415.      (choices "compress" "gzip" "freeze" "none")
  416.      (prompt "Which command should smail/rmail\nuse to compress the BSMTP mails ?\n")
  417.      (help "The command to compress your BSMTP mails. "
  418.            "The command is:\nexecute cmd <infile >outfile")
  419.      (default 1)
  420.     )
  421.  )
  422.  
  423.  (if (<> 3 nr)
  424.   (set line9
  425.    (askfile
  426.     (prompt "Where is your compress command ?\n")
  427.     (help "I need the complete path of the command. ")
  428.     (default "compress")
  429.    )
  430.   )
  431.  )
  432.  
  433. ; compress
  434.  (if (= 0 nr)
  435.       (set line10 "rcsmtp")
  436.  )
  437. ; gzip
  438.  (if (= 1 nr)
  439.       (set line10 "rcsmtp")
  440.  )
  441. ; freeze
  442.  (if (= 2 nr)
  443.       (set line10 "rfsmtp")
  444.  )
  445. ; none
  446.  (if (= 3 nr)
  447.       (set line10 "rsmtp")
  448.  )
  449.  
  450.  (set line11
  451.   (askfile
  452.    (prompt "Where is the file, with your BSMTP sites ?\n")
  453.    (help "The file with all hosts, which receives mails via BSMTP. Simply one site by every line.")
  454.    (default "uulib:mail/bsmtp_sites")
  455.   )
  456.  )
  457.  
  458.  (set line14
  459.   (if
  460.    (= 0
  461.     (askchoice
  462.      (choices "no restrictions"  "restrictions")
  463.      (prompt "Smail offers you the opportunity to allow only "
  464.              "to some local users to write mail via UUCP/BSMTP")
  465.      (help   "See smail.guide")
  466.      (default 0)
  467.     )
  468.    )
  469.    ("No")
  470.    ("Yes")
  471.   )
  472.  )
  473.  
  474.  (if (<> choice 2)
  475.   (if (= line14 "Yes")
  476.    (set line13
  477.     (askfile
  478.      (prompt "Where is the file, with your local users which are allowed to mail outsite your site?")
  479.      (help "The file with all users which are allowed to mail via UUCP/BSMTP. Simply one user by every line.")
  480.      (default "uulib:mail/checkuser")
  481.     )
  482.    )
  483.   )
  484.  )
  485.  
  486.  (textfile
  487.   (dest "t:add_to_config")
  488.   (prompt "Generating new "UULIB"config file")
  489.   (include (tackon UULIB "config"))
  490.   (append "\n# Options for SMail\n")
  491.   (append "SMDebug 0\n")
  492.   (append "SMSmarthost ")
  493.   (append line1)
  494.   (append "\n")
  495.   (append "SMLogfile ")
  496.   (if (= "" line2)
  497.      (append "NIL:")
  498.      (append line2)
  499.   )
  500.   (append "\n")
  501.   (append "SMMaillogfile ")
  502.   (if (= "" line3)
  503.      (append "NIL:")
  504.      (append line3)
  505.   )
  506.   (append "\n")
  507.   (append "SMSentlog ")
  508.   (if (= "" line4)
  509.      (append "NIL:")
  510.      (append line4)
  511.   )
  512.   (append "\n")
  513.   (append "SMAlias ")
  514.   (append line6)
  515.   (append "\n")
  516.   (if (= 0 axsh)
  517.       (
  518.      (append "SMPasswd ")
  519.      (append line5)
  520.      (append "\n")
  521.      )
  522.   )
  523.   (append "SMPath ")
  524.   (append line12)
  525.   (append "\n")
  526.   (append "SMRerouting ")
  527.   (append line7)
  528.   (append "\n")
  529.   (append "SMReceipt ")
  530.   (append line8)
  531.   (append "\n")
  532.   (if (<> nr 3)
  533.       (
  534.      (append "SMCompress ")
  535.       (append line9)
  536.       (append "\n")
  537.      )
  538.   )
  539.   (append "SMBsmtpCmd ")
  540.   (append line10)
  541.   (append "\n")
  542.   (append "SMBsmtpSites ")
  543.   (append line11)
  544.   (append "\n")
  545.   (append "SMCheckuser ")
  546.   (append line14)
  547.   (append "\n")
  548.   (if (<> choice 2)
  549.    (if (= line14 "Yes")
  550.     (
  551.     (append "SMCheckFile ")
  552.     (append line13)
  553.     (append "\n")
  554.     )
  555.    )
  556.   )
  557.  )
  558.  
  559.  (run "copy uulib:config uulib:config.o")
  560.  (run "copy t:add_to_config uulib:config")
  561.  (run "delete t:add_to_config")
  562.  )
  563. )
  564. ;=================== showing AmigaGuide ==================
  565. (run "run AmigaGuide smail.guide"
  566.     (prompt "Running AmigaGuide smail.guide.")
  567.     (safe)
  568. )
  569.  
  570. ;=================== sending the accounting mail =========
  571. (debug (run ("c:echo >t:smail_version")))
  572. (debug (run ("c:echo >>t:smail_version \"Version strings of the commands\"")))
  573. (debug (run (cat "c:Version >>t:smail_version full "smail)))
  574. (debug (run (cat "c:Version >>t:smail_version full "mail)))
  575. (debug (run (cat "c:Version >>t:smail_version full "batch_smtp)))
  576.  
  577. (debug (run ("c:echo >t:smail_run stack 80000")))
  578. (debug (run (cat "c:echo >>t:smail_run \""sendmail" <t:smail_version -t smail@mavhh.hanse.de -s SMail_account_msg\"")))
  579.  
  580. (run ("c:execute t:smail_run sendmail"))
  581.  
  582. (run "c:delete t:smail_version")
  583. (run "c:delete t:smail_run")
  584.  
  585. (complete 100)
  586. (exit "SMail is now (hopefully correct) installed. "
  587.       "You should edit/setup the paths file. Please read the "
  588.       "\"Installation/Setup a pathfile\" section in smail.guide. "
  589.       "Copys of your previous smail/rmail etc programs can be found in t:.\n"
  590.       "Attention !!! This Installer script sends a mail with the version strings "
  591.       "of the installed programs to a special account (smail@mavhh.hanse.de) "
  592.       "at the site of the smail programmer. "
  593. )
  594.